<template>
	<!-- 
		拍卖进度
	 -->
	<view class="centent">
		<view class="tabs">
			<u-tabs :list="progressList" :current="index" lineWidth="50" lineColor="#222" :activeStyle="{
			            color: '#333',
			            transform: 'scale(1.05)'
			        }" :inactiveStyle="{
			            color: '#999',
			            transform: 'scale(1)'
			        }" itemStyle="padding-left: 10rpx;  height: 50px;" @click="onTabs">
			</u-tabs>
			<!-- 	
				列表信息展示
			 -->
			<view v-if="index == 0">
				<!-- 拍卖中 -->
				<ItemDisplay v-if="underAuction.length" :infoList="underAuction" />
			</view>
			<view v-if="index == 1">
				<!-- 拍卖中 -->
				<ItemDisplay v-if="inPreview.length" :infoList="inPreview" />
			</view>
			<view v-if="index == 2">
				<!-- 拍卖中 -->
				<ItemDisplay v-if="closed.length" :infoList="closed" />
			</view>
		</view>
	</view>
</template>

<script>
	import ItemDisplay from '../components/ItemDisplay.vue'
	export default {
		components: {
			ItemDisplay
		},
		data() {
			return {
				progressList: [{
					name: '预展中'
				}
				// , {
				// 	name: '展览中',
				// }
				// , {
				// 	name: '已结束'
				// },
				],
				index: 0,
				// 拍卖中数据列表
				underAuction: [],

				// 预展中数据列表
				inPreview: [],

				// 已结束数据列表
				closed: [],

				page: 1,
				pageSize: 10
			}
		},
		onLoad(options) {
			this.index = options.index
			this.progress()
		},
		methods: {
			onTabs(item) {
				this.index = item.index
			},

			async progress() {
				let {
					result
				} = await uniCloud.callFunction({
					name: 'consultList',
					data: {
						consultState: 1
					}
				});

				this.underAuction = result.data
				this.inPreview = result.data
				this.closed = result.data
			},
		}

	}
</script>

<style lang="scss" scoped>
	.centent {


		.tabs {
			background-color: #fff;

			/deep/ .u-tabs__wrapper__nav__line {
				height: 5rpx !important;
			}
		}
	}
</style>
